package com.binvshe.binvshe.activity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Zoi.
 * E-mail：KyluZoi@gmail.com
 * 2016/9/24
 */

public class OrderEntity implements Parcelable {

    /**
     * id : 39
     * order_no : 20160924231055411220
     * user : {"user_id":216,"club":{"id":122,"im_group_id":"244196467688866224","user_id":231,"name":"单身狗","catid":5,"portrait":"http://static.binvshe.com/static/modo/20160921092600179782_100*100.png","sign":null,"introduction":"","province":"福建","city":"厦门","longitude":0,"latitude":0,"name_py":"danshengou","initial":"D","state":true,"del":false,"create_time":1474421221000,"update_time":1474421221000,"cate_name":null,"member_count":0,"fans":0,"leader_id":null},"login_name":"13459730010","real_name":null,"nick_name":"kyluzoi","gender":0,"portrait":"http://static.binvshe.com/static/modo/20160924200339223975_121*121.png","longitude":0,"latitude":0,"birthday":null,"constellation":null,"phone":"13459730010","sign":"sdfsdfsfasd","province":"广东","city":"惠州","coin":0,"company":null,"locked":false,"initial":"K","fans":0,"in_club":true}
     * receiver_id : 216
     * name : 10月01日夜场券
     * type : false
     * total_price : 0.03
     * state : 0
     * detail : 购买门票:10月01日夜场券:0.03 元
     * trading_no :
     * pay_type : null
     * del : false
     * create_time : 1474729855413
     * update_time : 1474729855413
     */

    private int id;
    private String order_no;
    /**
     * user_id : 216
     * club : {"id":122,"im_group_id":"244196467688866224","user_id":231,"name":"单身狗","catid":5,"portrait":"http://static.binvshe.com/static/modo/20160921092600179782_100*100.png","sign":null,"introduction":"","province":"福建","city":"厦门","longitude":0,"latitude":0,"name_py":"danshengou","initial":"D","state":true,"del":false,"create_time":1474421221000,"update_time":1474421221000,"cate_name":null,"member_count":0,"fans":0,"leader_id":null}
     * login_name : 13459730010
     * real_name : null
     * nick_name : kyluzoi
     * gender : 0
     * portrait : http://static.binvshe.com/static/modo/20160924200339223975_121*121.png
     * longitude : 0
     * latitude : 0
     * birthday : null
     * constellation : null
     * phone : 13459730010
     * sign : sdfsdfsfasd
     * province : 广东
     * city : 惠州
     * coin : 0
     * company : null
     * locked : false
     * initial : K
     * fans : 0
     * in_club : true
     */

    private int receiver_id;
    private String name;
    private boolean type;
    private double total_price;
    private int state;
    private String detail;
    private String trading_no;
    private boolean del;
    private long create_time;
    private long update_time;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getOrder_no() {
        return order_no;
    }

    public void setOrder_no(String order_no) {
        this.order_no = order_no;
    }


    public int getReceiver_id() {
        return receiver_id;
    }

    public void setReceiver_id(int receiver_id) {
        this.receiver_id = receiver_id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isType() {
        return type;
    }

    public void setType(boolean type) {
        this.type = type;
    }

    public double getTotal_price() {
        return total_price;
    }

    public void setTotal_price(double total_price) {
        this.total_price = total_price;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getDetail() {
        return detail;
    }

    public void setDetail(String detail) {
        this.detail = detail;
    }

    public String getTrading_no() {
        return trading_no;
    }

    public void setTrading_no(String trading_no) {
        this.trading_no = trading_no;
    }



    public boolean isDel() {
        return del;
    }

    public void setDel(boolean del) {
        this.del = del;
    }

    public long getCreate_time() {
        return create_time;
    }

    public void setCreate_time(long create_time) {
        this.create_time = create_time;
    }

    public long getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(long update_time) {
        this.update_time = update_time;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeString(this.order_no);
        dest.writeInt(this.receiver_id);
        dest.writeString(this.name);
        dest.writeByte(type ? (byte) 1 : (byte) 0);
        dest.writeDouble(this.total_price);
        dest.writeInt(this.state);
        dest.writeString(this.detail);
        dest.writeString(this.trading_no);
        dest.writeByte(del ? (byte) 1 : (byte) 0);
        dest.writeLong(this.create_time);
        dest.writeLong(this.update_time);
    }

    public OrderEntity() {
    }

    protected OrderEntity(Parcel in) {
        this.id = in.readInt();
        this.order_no = in.readString();
        this.receiver_id = in.readInt();
        this.name = in.readString();
        this.type = in.readByte() != 0;
        this.total_price = in.readDouble();
        this.state = in.readInt();
        this.detail = in.readString();
        this.trading_no = in.readString();
        this.del = in.readByte() != 0;
        this.create_time = in.readLong();
        this.update_time = in.readLong();
    }

    public static final Parcelable.Creator<OrderEntity> CREATOR = new Parcelable.Creator<OrderEntity>() {
        public OrderEntity createFromParcel(Parcel source) {
            return new OrderEntity(source);
        }

        public OrderEntity[] newArray(int size) {
            return new OrderEntity[size];
        }
    };
}
